<template>
  <div class="hot-goods" v-show="hotGoods.length > 0">
    <div class="header">商品精选</div>
    <div class="goods-container">
      <div class="goods-list" v-for="(goodsInfo, index) in hotGoods" :key="index">
        <goods-item :goods-info="goodsInfo" :theme="3"></goods-item>
      </div>
    </div>
  </div>
</template>

<script>
import goodsItem from '../../search/components/GoodsItem'

export default {
  components: {
    goodsItem
  },
  props: {
    hotGoods: {
      type: Array,
      default: () => { return [] }
    }
  }
}
</script>

<style lang="scss" scoped>
.hot-goods {
  border: 1px solid #DDDDDD;
  font-size: 12px;
  width: 190px;

  .header {
    font-size: 14px;
    height: 50px;
    line-height: 50px;
    text-align: center;
  }
  .goods-container {
    padding: 0px 8px;

    .goods-list {
      border-bottom: 1px solid #DDDDDD;
      font-size: 14px;
      width: 100%;
      max-width: 250px;
      padding: 10px 10px; 

      &:last-child {
        border-bottom: 0px;
      }

      img {
        width: 100%;
      }

      .price {
        color: #F00384;
        margin-top: 20px;
        margin-bottom: 20px;
        padding-left: 10px;
      }

      .name {
        color: #404040;
        padding-left: 10px;
        padding-bottom: 10px;
      }
    }
  }
}
</style>